#include <iostream>
#include <cmath>
using namespace std;
int main(){
	int n;
	
	while(cin>>n){
			int k=0;
		if(n==1) cout<<"1"<<endl;
		if(n==2) cout<<"2"<<endl;
		if(n>=3){
		int y=1,x=2;
		for(int i=3;i<=n&&n<=31;i++){
			x=x+y;
			y=x-y;
			k=x;
		}			
		}
		cout<<k<<endl;
	}
	return 0;
}
